package com.wquick.base

import android.content.ContentProvider
import android.content.ContentValues
import android.content.Context
import android.database.Cursor
import android.net.Uri
import com.wquick.base.utils.permissionFlow.PermissionFlow

//<provider
//android:name="com.wquick.base.WQuickBaseInit"
//android:authorities="${applicationId}.wquick.base.InitProvider"
//android:exported="false"
//android:multiprocess="true" />

class WQuickBaseInit : ContentProvider() {

    private fun doInit(ctx: Context) {
        PermissionFlow.init(ctx)
        PermissionFlow.getInstance().startListening()
    }

    override fun onCreate(): Boolean {
        context?.let { doInit(it) }
        return true
    }

    override fun query(
        uri: Uri, strings: Array<String>?, s: String?, strings1: Array<String>?,
        s1: String?
    ): Cursor? {
        return null
    }

    override fun getType(uri: Uri): String? {
        return null
    }

    override fun insert(uri: Uri, contentValues: ContentValues?): Uri? {
        return null
    }

    override fun delete(uri: Uri, s: String?, strings: Array<String>?): Int {
        return 0
    }

    override fun update(
        uri: Uri,
        contentValues: ContentValues?,
        s: String?,
        strings: Array<String>?
    ): Int {
        return 0
    }
}
